//
//  WZBaseTableViewController.m
//  weibo
//
//  Created by mac on 16/2/25.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "WZBaseTableViewController.h"
#import "WZVisitor.h"
#import "WZAuthController.h"
#import "WZUserViewModel.h"
@interface WZBaseTableViewController ()<visitorDelegate>

@end

@implementation WZBaseTableViewController

//重写loadview方法在里面判断如果以前登录过就显示tableview界面，否则显示访客界面
-(void)loadView{
    WZUserViewModel *userViewModel = [WZUserViewModel shareInstance];
    if (userViewModel.isLogin) {
        [super loadView];
    }else{
        [self setVisitor];
    }
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    


}


-(void)setVisitor{
    WZVisitor *visitor = [[WZVisitor alloc] init];
    self.visitor = visitor;
    
    visitor.delegate = self;
    self.visitor.backgroundColor = [[UIColor alloc]initWithWhite:237/255.0 alpha:1];
    [self.visitor setAnimation];
    self.view = self.visitor;
    
}
-(void)login{
    
    [self presentViewController:[[UINavigationController alloc]initWithRootViewController:[[WZAuthController alloc]init]] animated:YES completion:nil];
    
}
-(void)registe{
    
}

@end
